if(1)
 k = 10;
 t = 20;
 n = 128;
 % F = randn(n,k) * randn(k,n);
 % Z = 1e-14*rand(n,n);
 % A = F+Z;

 R1 = randn(n,t);
 [U,S,T] = svd(A*R1,'econ');
 U = U(:,find(diag(S)>1e-12));
 R2 = randn(t,n);
 [T,S,V] = svd(R2*A,'econ');
 V = V(:,find(diag(S)>1e-12));

 B = pinv(R2*U) * (R2*A*R1) * pinv(V'*R1);
 % fprintf('norm of best approximation %d\n', norm(Z));
 fprintf('norm of constructed approximation %d\n', norm(A-U*B*V')./norm(A));
end 

